import {request} from '@/utils/request' 
// import {oederRequest} from './oederRequest'


// 产品列表查询
export const getByPage = <T>(data?:T) => {  
    return request({
        url:"merchant/travel/product/listTravelProduct",
        method:"POST",
        data:data
    });
};

// 旅行社信息查询
export const queryTravel = <T>(data?:T) => {  
    return request({
        url:"merchant/travel/product/queryTravel?id="+ data.value,
        method:"GET"
    });
};

// 旅行社产品查询
export const queryTravelProduct = <T>(data?:T) => {  
    return request({
        url:"merchant/travel/product/queryTravelProduct?id="+ data.value,
        method:"GET"
    });
};
 // 旅行社产品详情查询
export const queryTravelProductDetail = <T>(data?:T) => {  
    return request({
        url:"merchant/travel/product/queryTravelProductDetails?id="+ data,
        method:"GET"
    });
};


// 新增私人定制
export const addCustomized = <T>(data?:T) => {  
    return request({
        url:"merchant/customized/client/add",
        method:"POST",
        data:data
    });
};

// 私人订制列表查询
export const getCustomizedList = <T>(data?:T) => {  
    return request({
        url:"merchant/customized/client/list",
        method:"GET"
    });
};

// 私人订制列表查询
export const deleteCustomizedList = <T>(data?:T) => {  
    return request({
        url:"merchant/customized/client/delete?id=" + data,
        method:"GET"
    });
};

// 店铺信息查询
export const queryMerchant = <T>(data?:T) => {  
    return request({
        url:"merchant/travel/product/queryMerchant?id=" + data,
        method:"GET"
    });
};

// 日历价信息查询
export const queryProductThaliPrice = <T>(data?:T) => {  
    return request({
        url:"merchant/travel/product/queryProductThaliPrice?id=" + data.id +`&thaliDate=` + data.thaliDate,
        method:"GET"
    });
};


// 创建订单
export const addOrder = <T>(data?:T) => {  
    return request({
        url:"order/travel/product/order/add",
        method:"POST",
        data:data
    });
};

// 获取订单详情
export const queryAgencyOrder = <T>(data?:T) => {  
    return request({
        url:"order/client/getOrderInfo?orderId=" + data,
        method:"GET"
    });
};

// 取消订单
export const cancelOrder = <T>(data?:T) => {  
    return request({
        url:"order/client/cancel",
        method:"POST",
        data:data,
        isFormData:true,
    });
};


// 申请退款
export const requestRefund = <T>(data?:T) => {  
    return request({
        url:"order/travel/product/order/requestRefund",
        method:"POST",
        data:data,
    });
};

// 获取退款详情
export const orderRefundQuery = <T>(data?:T) => {  
    return request({
        url:"order/travel/product/order/orderRefundQuery?id=" + data,
        method:"GET",
        isFormData:true,
    });
};

// 获取退款详情（公共）
export const refundOrderInfo = <T>(data?:T) => {  
    return request({
        url:"order/client/refundOrderList",
        method:"POST",
        data:data,
    });
};
